package com.gxt.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gxt.basic.domain.BaseDomain;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BaseDomain {
    @ApiModelProperty("名字")
    private String name;

    @ApiModelProperty("描述")
    private String intro;

    @ApiModelProperty("创建时间")
    private Date create_time;

    @ApiModelProperty("修改时间")
    private Date update_time;

    @ApiModelProperty("部门领导")
    private Employee manager;

    @ApiModelProperty("父部门")
    private Department parent;

    @ApiModelProperty("部门path")
    private String path;

    @ApiModelProperty("部门状态 1:正常 0:禁用")
    private Integer state;

    @ApiModelProperty("子部门集合")
    private List<Department> children;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date getCreate_time() {
        return create_time;
    }

    @DateTimeFormat
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date getUpdate_time() {
        return update_time;
    }

    @DateTimeFormat
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
}
